<script setup lang="ts">
import store from "@/store";
import { BannerList } from "@/views/Home/components/api";
import useHomeStore from "@/store/modules/home"

const { proxy } = getCurrentInstance() as ComponentInternalInstance;

//获取bannerList数据
const pd = reactive({
  bannerList:<BannerList[]>([]),
  queryParams: <BannerList>{
    pageNum: 1,
    pageSize: 5
  },
})

async function getBanner(){
  useHomeStore().getAllBannerList().then(res=>{
    pd.bannerList = res;
  });
}

onMounted(()=>{
  getBanner();
})
</script>

<template>
  <div class="home-banner">
    <XtxSlider :sliders="useHomeStore().bannerList" auto-play />
  </div>
</template>

<style scoped lang="scss">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
